package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallUtmSource;
import com.appkubes.mall.core.po.MallUtmSourceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallUtmSourceMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUtmSourceSqlProvider.class, method="countByExample")
    long countByExample(MallUtmSourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallUtmSourceSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallUtmSourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_utm_source",
        "where utm_key = #{utmKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String utmKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_utm_source (utm_key, app_key, ",
        "utm_code, utm_name, ",
        "contact_phone, is_deduction, ",
        "deduction_rate, cpa, ",
        "uv, uv_price, cps, ",
        "source_type, `state`, ",
        "access_token, create_time, ",
        "update_time, version)",
        "values (#{utmKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{utmCode,jdbcType=VARCHAR}, #{utmName,jdbcType=VARCHAR}, ",
        "#{contactPhone,jdbcType=VARCHAR}, #{isDeduction,jdbcType=INTEGER}, ",
        "#{deductionRate,jdbcType=INTEGER}, #{cpa,jdbcType=INTEGER}, ",
        "#{uv,jdbcType=INTEGER}, #{uvPrice,jdbcType=DECIMAL}, #{cps,jdbcType=INTEGER}, ",
        "#{sourceType,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT}, ",
        "#{accessToken,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallUtmSource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallUtmSourceSqlProvider.class, method="insertSelective")
    int insertSelective(MallUtmSource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUtmSourceSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="utm_key", property="utmKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_code", property="utmCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_name", property="utmName", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_deduction", property="isDeduction", jdbcType=JdbcType.INTEGER),
        @Result(column="deduction_rate", property="deductionRate", jdbcType=JdbcType.INTEGER),
        @Result(column="cpa", property="cpa", jdbcType=JdbcType.INTEGER),
        @Result(column="uv", property="uv", jdbcType=JdbcType.INTEGER),
        @Result(column="uv_price", property="uvPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="cps", property="cps", jdbcType=JdbcType.INTEGER),
        @Result(column="source_type", property="sourceType", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="access_token", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUtmSource> selectByExampleWithRowbounds(MallUtmSourceExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUtmSourceSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="utm_key", property="utmKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_code", property="utmCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_name", property="utmName", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_deduction", property="isDeduction", jdbcType=JdbcType.INTEGER),
        @Result(column="deduction_rate", property="deductionRate", jdbcType=JdbcType.INTEGER),
        @Result(column="cpa", property="cpa", jdbcType=JdbcType.INTEGER),
        @Result(column="uv", property="uv", jdbcType=JdbcType.INTEGER),
        @Result(column="uv_price", property="uvPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="cps", property="cps", jdbcType=JdbcType.INTEGER),
        @Result(column="source_type", property="sourceType", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="access_token", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUtmSource> selectByExample(MallUtmSourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "utm_key, app_key, utm_code, utm_name, contact_phone, is_deduction, deduction_rate, ",
        "cpa, uv, uv_price, cps, source_type, `state`, access_token, create_time, update_time, ",
        "version",
        "from mall_utm_source",
        "where utm_key = #{utmKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="utm_key", property="utmKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_code", property="utmCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="utm_name", property="utmName", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_deduction", property="isDeduction", jdbcType=JdbcType.INTEGER),
        @Result(column="deduction_rate", property="deductionRate", jdbcType=JdbcType.INTEGER),
        @Result(column="cpa", property="cpa", jdbcType=JdbcType.INTEGER),
        @Result(column="uv", property="uv", jdbcType=JdbcType.INTEGER),
        @Result(column="uv_price", property="uvPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="cps", property="cps", jdbcType=JdbcType.INTEGER),
        @Result(column="source_type", property="sourceType", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT),
        @Result(column="access_token", property="accessToken", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallUtmSource selectByPrimaryKey(String utmKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUtmSourceSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallUtmSource record, @Param("example") MallUtmSourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUtmSourceSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallUtmSource record, @Param("example") MallUtmSourceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUtmSourceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallUtmSource record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_utm_source
     *
     * @mbg.generated
     */
    @Update({
        "update mall_utm_source",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "utm_code = #{utmCode,jdbcType=VARCHAR},",
          "utm_name = #{utmName,jdbcType=VARCHAR},",
          "contact_phone = #{contactPhone,jdbcType=VARCHAR},",
          "is_deduction = #{isDeduction,jdbcType=INTEGER},",
          "deduction_rate = #{deductionRate,jdbcType=INTEGER},",
          "cpa = #{cpa,jdbcType=INTEGER},",
          "uv = #{uv,jdbcType=INTEGER},",
          "uv_price = #{uvPrice,jdbcType=DECIMAL},",
          "cps = #{cps,jdbcType=INTEGER},",
          "source_type = #{sourceType,jdbcType=VARCHAR},",
          "`state` = #{state,jdbcType=TINYINT},",
          "access_token = #{accessToken,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER}",
        "where utm_key = #{utmKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallUtmSource record);
}